package cn.chuan.keygen.module.verify.controller.app.card;

import cn.chuan.keygen.framework.common.pojo.CommonResult;
import cn.chuan.keygen.module.verify.controller.app.card.vo.CardUpdateVO;
import cn.chuan.keygen.module.verify.service.card.CardService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.annotation.security.PermitAll;
import jakarta.validation.Valid;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import static cn.chuan.keygen.framework.common.pojo.CommonResult.success;

/**
 * @author zc
 * @date 2024年05月11日 15:14
 */
@Tag(name = "用户App - 充值卡")
@RestController
@RequestMapping("/verify/card")
@Validated
public class CardAppController {

    @Resource
    private CardService cardService;

    @PermitAll
    @PostMapping("/bind")
    @Operation(summary = "设备绑定卡号")
    public CommonResult<Boolean> bindCard(@Valid @RequestBody CardUpdateVO cardUpdateVO) {
        cardService.bindCard(cardUpdateVO);
        return success(true);
    }
}
